﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentValidation;
using Huirui.Cavan.Domain.MainBoundedContext.Resources;

namespace Huirui.Cavan.Domain.MainBoundedContext.PurchaseModule
{
    public class PayValidator : AbstractValidator<Pay>
    {
        public PayValidator()
        {
            RuleFor(d => d.Id).NotEmpty().WithMessage(Messages.Validate_IdNotEmpty);
            RuleFor(d => d.Currency).NotEmpty().WithMessage(Messages.Validate_CurrencyNotEmpty);
            RuleFor(d => d.Corporation).NotNull().WithMessage(Messages.Validate_CorporationNotNull);
            RuleFor(d => d.Supplier).NotNull().WithMessage(Messages.Validate_SupplierNotNull);
            RuleFor(d => d.CurrencyRate).GreaterThan(0).WithMessage(Messages.Validate_CurrencyRateIsInvalid);
        }
    }
}
